package com.sinosoft.perfect.system._unit.dao;

import java.sql.SQLException;
import java.util.List;

import com.sinosoft.perfect.common.system.BaseSqlSessionDaoSupport;
import com.sinosoft.perfect.system._.po.TUnit;
import com.sinosoft.perfect.system._.po.TUnitInformation;
import com.sinosoft.perfect.system._.po.TUserRegisterNum;
import com.sinosoft.perfect.system._unit.MapperSystemUnit;
import com.sinosoft.perfect.system._unit.formBean.UnitForm;

public class UnitDAOImpl extends BaseSqlSessionDaoSupport implements IUnitDAO {

	private MapperSystemUnit getMapperSystemUnit() {
		return getSqlSession().getMapper(MapperSystemUnit.class);
	}

	@Override
	public Object insertTUnit(TUnit tunit) throws SQLException {
		return getMapperSystemUnit().insertTUnit(tunit);
	}

	@Override
	public Object insertTUnitInformation(TUnitInformation tunitinformation) throws SQLException {
		return getMapperSystemUnit().insertTUnitInformation(tunitinformation);
	}

	@Override
	public Object insertTUserRegisterNum(TUserRegisterNum tuserregisternum) throws SQLException {
		return getMapperSystemUnit().insertTUserRegisterNum(tuserregisternum);
	}

	@Override
	public List<UnitForm> selectTUnit(TUnit tunit) throws SQLException {
		return getMapperSystemUnit().selectTUnit(tunit);
	}

	@Override
	public List<TUnit> selectTUnitAndChildren(String unitId) throws SQLException {
		return getMapperSystemUnit().selectTUnitAndChildrenByUnitId(unitId);
	}

	@Override
	public Object selectTUnitSortNum(TUnit tunit) throws SQLException {
		return getMapperSystemUnit().selectTUnitSortNum(tunit);
	}

	@Override
	public Object selectTUnitMAXSortNum(TUnit tunit) throws SQLException {
		return getMapperSystemUnit().selectTUnitMAXSortNum(tunit);
	}

	@Override
	public Object selectTUnitByName(TUnit tunit) throws SQLException {
		return getMapperSystemUnit().selectTUnitByName(tunit);
	}

	@Override
	public List<TUnitInformation> selectTUnitInfo(TUnitInformation tunitinformation) throws SQLException {
		return getMapperSystemUnit().selectTUnitInfo(tunitinformation);
	}

	@Override
	public List<TUserRegisterNum> selectTUserRegisterNum(TUserRegisterNum tuserregisternum) throws SQLException {
		return getMapperSystemUnit().selectTUserRegisterNum(tuserregisternum);
	}

	@Override
	public List<TUserRegisterNum> selectTUserRegisterNumByNum(TUserRegisterNum tuserregisternum) throws SQLException {
		return getMapperSystemUnit().selectTUserRegisterNumByNum(tuserregisternum);
	}

	@Override
	public int updateTUnitByPK(TUnit tunit) throws SQLException {
		return getMapperSystemUnit().updateTUnit(tunit);
	}

	@Override
	public int updateTUnitStatusByPK(TUnit tunit) throws SQLException {
		return getMapperSystemUnit().updateTUnitAndChildrenStatus(tunit);
	}

	@Override
	public int updateTUnitInfoByPK(TUnitInformation tunitinformation) throws SQLException {
		return getMapperSystemUnit().updateTUnitInfoByPK(tunitinformation);
	}

	@Override
	public int updateTUserRegisterNumByPK(TUserRegisterNum tuserregisternum) throws SQLException {
		return getMapperSystemUnit().updateTUserRegisterNumByPK(tuserregisternum);
	}

	@Override
	public int updateTUserRegisterNumTimesByUnitId(String unitId) throws SQLException {
		return getMapperSystemUnit().updateTUserRegisterNumTimesByUnitId(unitId);
	}

	@Override
	public int deleteTUnits(String unitId) throws SQLException {
		return getMapperSystemUnit().deleteTUnitByUnitId(unitId);
	}

	@Override
	public int deleteTUserUnitRelation(String unitId) throws SQLException {
		return getMapperSystemUnit().deleteTUserUnitRelationByUnitId(unitId);
	}

	@Override
	public int deleteTUnitInformation(String unitId) throws SQLException {
		return getMapperSystemUnit().deleteTUnitInfoByUnitId(unitId);
	}

	@Override
	public int deleteTUserRegisterNumByUnitId(String unitId) throws SQLException {
		return getMapperSystemUnit().deleteTUserRegisterNumByUnitId(unitId);
	}

	@Override
	public List<TUnit> selectTUnitByUnitIds(String unitIds) throws SQLException {
		return getMapperSystemUnit().selectTUnitByUnitIds(unitIds);
	}

}
